<html>
  <head>
    <title>School Bill</title>
    <link rel="stylesheet" type="text/css" href="<?php echo base_url(); ?>css/style.css" />
    <script type="text/javascript" src="<?php echo base_url(); ?>js/jquery-1.7.1.min.js"></script>
    <script type="text/javascript" src="<?php echo base_url(); ?>js/billing.js"></script>
    <script>
	var BASE_URL = "<?php echo base_url(); ?>";
    </script>
  </head>
  <body>
      <div id="warpper">
	  <div id="content">
	      <div id="contentHeader">
		<table width="100%">
		    <tr>
			<td><img src="<?php echo base_url(); ?>images/default-logo.png"/></td>
			<td><h1 style="color: #8ACFA0;">Velammal engineering college</h1></td>
		    </tr>
		</table>
	      </div>
	      <div id="billContainer">
		  <form id="billFormContainer" method="post" action="<?php echo base_url(); ?>index.php/billing/savePrintBill">
		  <table id="billContainerTable" border="1">
		      <tr>
			  <td><lable for="name">Name</label></td>
			  <td><input type="text" value="" id="studentName" name="studentName"></td>
			  <td><lable for="standard">Standard</label></td>
			  <td>
			      <select id="standard" name="standard">
				  <?php foreach($standard as $standardName) : ?>
				      <option><?php echo $standardName; ?></option>
				  <?php endforeach; ?>
			      </select>
			  </td>
		      </tr>
		      <tr>
			  <td colspan="2"><lable for="name">FEE PARTICULARS</label></td>
			  <td>RS</td>
			  <td>P.</td>
		      </tr>
		       <tr>
			  <td><lable for="name">01</label></td>
			  <td><lable for="Registration Fee">Registration Fee</label></td>
			  <td><input type="text" value="" class="feeEntryInputText feeEntryInputTextRs" id="registrationRs" name="registrationRs"></td>
			  <td><input type="text" value="" class="feeEntryInputText feeEntryInputTextP" id="registrationP" name="registrationP"></td>
		      </tr>
		      <tr>
			  <td><lable for="name">02</label></td>
			  <td><lable for="Admission Fee">Admission Fee</label></td>
			  <td><input type="text" value="" class="feeEntryInputText feeEntryInputTextRs" id="admissionRs" name="admissionRs"></td>
			  <td><input type="text" value="" class="feeEntryInputText feeEntryInputTextP" id="admissionP" name="admissionP"></td>
		      </tr>
		      <tr>
			  <td><lable for="TuitionSno">03</label></td>
			  <td><lable for="Tuition Fee">Tuition Fee</label></td>
			  <td><input type="text" value="" class="feeEntryInputText feeEntryInputTextRs" id="tuitionRs" name="tuitionRs"></td>
			  <td><input type="text" value="" class="feeEntryInputText feeEntryInputTextP" id="tuitionP" name="tuitionP"></td>
		      </tr>
		      <tr>
			  <td><lable for="name">04</label></td>
			  <td><lable for="Laboratory Fee">Laboratory Fee</label></td>
			  <td><input type="text" value="" class="feeEntryInputText feeEntryInputTextRs" id="LaboratoryRs" name="LaboratoryRs"></td>
			  <td><input type="text" value="" class="feeEntryInputText feeEntryInputTextP" id="LaboratoryP" name="LaboratoryP"></td>
		      </tr>
		      <tr>
			  <td><lable for="name">05</label></td>
			  <td><lable for="Library Fee">Library Fee</label></td>
			  <td><input type="text" value="" class="feeEntryInputText feeEntryInputTextRs" id="libraryRs" name="libraryRs"></td>
			  <td><input type="text" value="" class="feeEntryInputText feeEntryInputTextP" id="libraryP" name="libraryP"></td>
		      </tr>
		      <tr>
			  <td><lable for="name">06</label></td>
			  <td><lable for="Games Fee">Games / Sports Fee</label></td>
			  <td><input type="text" value="" class="feeEntryInputText feeEntryInputTextRs" id="gamesRs" name="gamesRs"></td>
			  <td><input type="text" value="" class="feeEntryInputText feeEntryInputTextP" id="gamesP" name="gamesP"></td>
		      </tr>
		      <tr>
			  <td><lable for="name">07</label></td>
			  <td><lable for="Special Fee">Special Fee</label></td>
			  <td><input type="text" value="" class="feeEntryInputText feeEntryInputTextRs" id="specialRs" name="specialRs"></td>
			  <td><input type="text" value="" class="feeEntryInputText feeEntryInputTextP" id="specialP" name="specialP"></td>
		      </tr>
		      <tr>
			  <td><lable for="name">08</label></td>
			  <td><lable for="Computer Fee">Computer Fee</label></td>
			  <td><input type="text" value="" class="feeEntryInputText feeEntryInputTextRs" id="computerRs" name="computerRs"></td>
			  <td><input type="text" value="" class="feeEntryInputText feeEntryInputTextP" id="computerP" name="computerP"></td>
		      </tr>
		      <tr>
			  <td><lable for="name">09</label></td>
			  <td><lable for="Stationary Fee">Stationary Fee</label></td>
			  <td><input type="text" value="" class="feeEntryInputText feeEntryInputTextRs" id="stationaryRs" name="stationaryRs"></td>
			  <td><input type="text" value="" class="feeEntryInputText feeEntryInputTextP" id="stationaryP" name="stationaryP"></td>
		      </tr>
		      <tr>
			  <td><lable for="name">10</label></td>
			  <td><lable for="Special Amenities Fee">Special Amenities Fee</label></td>
			  <td><input type="text" value="" class="feeEntryInputText feeEntryInputTextRs" id="specialAmenitiesRs" name="specialAmenitiesRs"></td>
			  <td><input type="text" value="" class="feeEntryInputText feeEntryInputTextP" id="specialAmenitiesP" name="specialAmenitiesP"></td>
		      </tr>
		      <tr>
			  <td><lable for="name">11</label></td>
			  <td><lable for="Transfer Certificate">Transfer Certificate Fee</label></td>
			  <td><input type="text" value="" class="feeEntryInputText feeEntryInputTextRs" id="transferCertificateRs" name="transferCertificateRs"></td>
			  <td><input type="text" value="" class="feeEntryInputText feeEntryInputTextP" id="transferCertificateP" name="transferCertificateP"></td>
		      </tr>
		      <tr>
			  <td><lable for="name">12</label></td>
			  <td><lable for="Hobby Fee">Hobby Fee</label></td>
			  <td><input type="text" value="" class="feeEntryInputText feeEntryInputTextRs" id="hobbyRs" name="hobbyRs"></td>
			  <td><input type="text" value="" class="feeEntryInputText feeEntryInputTextP" id="hobbyP" name="hobbyP"></td>
		      </tr>
		      <tr>
			  <td><lable for="name">13</label></td>
			  <td><lable for="Smart class Fee">Smart class Fee</label></td>
			  <td><input type="text" value="" class="feeEntryInputText feeEntryInputTextRs" id="smartClassFeeRs" name="smartClassFeeRs"></td>
			  <td><input type="text" value="" class="feeEntryInputText feeEntryInputTextP" id="smartClassFeeP" name="smartClassFeeP"></td>
		      </tr>
		      <tr>
			  <td><lable for="name">14</label></td>
			  <td><lable for="Fine">Fine</label></td>
			  <td><input type="text" value="" class="feeEntryInputText feeEntryInputTextRs" id="fineRs" name="fineRs"></td>
			  <td><input type="text" value="" class="feeEntryInputText feeEntryInputTextP" id="fineP" name="fineP"></td>
		      </tr>
		      <tr>
			  <td><lable for="name">15</label></td>
			  <td><lable for="Misc Receipt Fee">Misc. Receipt</label></td>
			  <td><input type="text" value="" class="feeEntryInputText feeEntryInputTextRs" id="receiptRs" name="receiptRs"></td>
			  <td><input type="text" value="" class="feeEntryInputText feeEntryInputTextP" id="receiptP" name="receiptP"></td>
		      </tr>
		      <tr rowspan="2">
			  <td colspan="2">
			      <div id="chequeNoContainer">
				  <label for="cheque">* By Cheque </label><label>No.:</label><input type="text" value="" name="chequeNo" id="chequeNo"> 
			      </div>
			      <div id="chequeBankNameContainer">
				  <label for="cheque">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</label><label>Bank:</label><input type="text" value="" name="chequeBankName" id="chequeBankName">
			      </div>
			  </td>
			  <td>
			  </td>
			  <td>
			  </td>
			  
		      </tr>
		         <tr rowspan="2">
			  <td colspan="2">
			    <label for="cheque"> By Cash </label>
			    <labe style="float:right">Total</label>
			  </td>
			  <td colspan="2">
			    <input type="text" value=""   id="totalRs" name="totalRs">
			  </td>  
		      </tr>
		  </table>
		  <div>
		     <table>
			<tr>
			    <td>
				<input type="button" id="savePrintBill" name="savePrintBill" value="save&print">
			    </td>	
			    <td>
				<input type="button" id="saveBill" name="saveBill" value="save">
			    </td>
			    <td>
				<input type="reset" name="clearFieldss" value="Clear">
			    </td>
			</tr>
		      </table>
		  </div>
		</form>
	      </div>

	      <div>
		  <div id="billingListContainer">
		      <div id="searchBill">
			  <div id="SearchBillTitle">Search Bill </div>
			  <form id="billSearchFormContainer" method="post" action="<?php echo base_url(); ?>index.php/billing/index">
			    <table id="billSearchFormTableContainer" border="1">
				<tr>
				  <td><label fro="searchBillNo">Bill No</label></td>
				  <td>
				      <input type="searchBillNo" name="searchBillNo" value="<?php echo !empty($searchBillNo) ? $searchBillNo : '' ?>" id="searchBillNo">
				  </td>
				  <td><label fro="searchStudentName">Student Name</label></td>
				  <td>
				      <input type="searchStudentName" name="searchStudentName" value="<?php echo !empty($searchStudentName) ? $searchStudentName : '' ?>" id="searchStudentName">
				  </td>
				</tr>
				<tr>
				  <td><label fro="searchStandard">Standard</label></td>
				  <td>
				       <select id="searchStandard" name="searchStandard">
					    <?php foreach($standard as $standardName) : ?>
						<option><?php echo $standardName; ?></option>
					    <?php endforeach; ?>
					</select>
				  </td>
				  <td><label fro="searchBillDate">Bill Date</label></td>
				  <td>
				      <input type="searchBillDate" name="searchBillDate" value="" id="searchBillDate">
				  </td>
				</tr>
				<tr>
				  
				  <td colspan="4">
					<input type="submit" id="search_button" value="search" name="search">&nbsp;&nbsp;&nbsp;
					<input type="reset" value="clear" name="resetSearch">
				  </td>
				</tr>
			    </table>
			    <input type="hidden" name="page" class="current_page" value="" id="page"  />
			  </form>
		      </div>
		      <div id="billingLists">
			  <table id="billingListsTable" border="1">
			      <tr>
				  <th>Bill No</th>
				  <th>Student Name</th>
				  <th>Standard</th>
				  <th>Bill Date</th>
				  <th>Total Amount</th>
				  <th>Action</th>
			      </tr>
			    <?php if(!empty($bill_details)) { ?>
				<?php foreach($bill_details as $bill_details_val) : ?>
				    <tr>
					<td><?php echo $bill_details_val['bill_no'];?></td>
					<td><?php echo $bill_details_val['student_name'];?></td>
					<td><?php echo $bill_details_val['standard'];?></td>
					<td><?php echo $bill_details_val['bill_date'];?></td>
					<td><?php echo $bill_details_val['total'];?></td>
					<?php if ($bill_details_val['is_bill_printed'] == 0) { ?>
					      <td><a href="<?php echo base_url(); ?>/index.php/billing/printBill/<?php echo $bill_details_val['id']  ?>">Print</td>
					<?php } ?>
				    </tr>
				  <?php endforeach; ?>
			    <?php } else { ?>
				<tr><td colspan="4">No records found.</td></tr>
			    <?php } ?>
			  </table>
      
		      </div>
		      <div id="pagination">
			<?php echo  $pagination; ?>
		      </div>
		  </div>
	  </div>
      </div>
  </body>
</html>